/*
* @Author: dengjiayao
* @Date:   2017-08-11 09:48:56
* @Last Modified by:   dengjiayao
* @Last Modified time: 2017-08-11 17:30:21
*/

import Vue from '../vue'
import store from '../vuex/store'
import { alert } from 'vue-strap'
import loginCheck from '../util/login-check'

import ExpertList from './expert-list/expert-list.vue'
import ExpertImport from './expert-import/expert-import.vue'

import { getExpertCategory } from '../vuex/action'

new Vue({
  el: 'body',
  data: {
    exportPrivilege: '0',
    mainCategory: [],
    industryCategory: []
  },
  components: {
    'vue-alert-msg': alert,
    'vue-expert-list': ExpertList,
    'vue-expert-import': ExpertImport
  },
  store,
  created() {
    loginCheck(this)
    getExpertCategory()
      .then((data) => {
        this.exportPrivilege = data.exportPrivilege
        this.mainCategory = data.mainCategory
        this.industryCategory = data.industryCategory
      })
  },
  vuex: {
    getters: {
      msg: state => state.msg
    }
  }
})
